home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
MODULES
/
DUDF.ZIP
/
dudf
/
!Help
next >
Wrap
Text File
|
1997-10-07
|
5KB
|
123 lines
du & df command line cutilities <= ie. a cute utility :-)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(c) Musus Umbra 1996
Permission is granted for unlimited personal use & modification.
Permission is granted for redistribution (by any method) provided that:
No charge is made for this software. A reasonable charge may be
made for media / handling / etc. This software is *free*.
Any distributed copy of this software must be unaltered and entire.
You may not distribute modified / imcomplete copies of this
software. If you fix a bug / add a feature, let me know so
that I can update the master copy.
As usual with freeware, there is no warranty of any kind. The author cannot
be help responsible for any loss/damage arising from the use/inability to
use this software. It is the user's responsibility to determine the fitness
of this software for any purpose they put it to.
(But if it doesn't work, I will try to help :-)
du
~~
du is a superior 'count' command. Unlike the system count command,
du provides flexible options controlling how the size of objects is
calculated and displayed. Use 'du -h' for help.
Display options:
-b, -k, -n :
These flags select what format directory sizes should be
displayed in. -b selects 'byte' mode, i.e. the size in
bytes will be displayed. -k selects 'K' mode, sizes are
displayed in kilobytes. -n selects 'auto' mode, sizes
are displayed in bytes, kilobytes or megabytes as
appropriate. The default is -k.
-c, -C :
This flag enables (-c) or disables (-C) the use of commas
when displaying numbers over 1000.
-r, -R :
Enables (-r) or disables (-R) rounding of *displayed*
numbers. This flag DOES NOT affect the eventual results,
only the numbers printed on the screen. If enabled,
all printed numbers will be rounded up/down to the nearest
unit (be that byte, kilobyte or megabyte).
-m<n>, -M, -s :
This option sets the maximum depth into a directory tree
that du will output size information for. Thus, -m1 causes
du to output size information for all the directories
in the counted directory (but no deeper).
-M sets the verbosity depth to 256, -s sets it to 0.
Thus, -s means just print the total size.
This option can be very useful, try du -m1 on your
!Fonts directory for example.
Counting Options:
-d, -D :
Enables/disables the inclusion of the size of directories
in the count of themselves. Directories actually occupy
disc space, however 'count' disregards this. Using this
flag you can count the actual disc space used by a directory
(see -a flag below), or ignore the size of directories as
you see fit.
-a<n>, -A :
The file size you get from, say, *Info is the extent of the
file. Usually, this is smaller than the actual disc space
occupied by the file. This is because disc space is
allocated in 'chunks'. The -a option allows you to specify
what the size of a 'chunk' is (in bytes). Typically, this
will be the size of an allocation unit on disc (usually
1024). The default value is 1024. Use -a0 (or -A) to
disable this feature.
-i, -I :
Enables/disables the treatment of images as directories.
Command line syntax:
Invoke du with the syntax:
du [flags] [<dir> ...] [ [flags] [<dir> ... ] ... ]
Flags affect all the directories named after them only, thus
'du -s fred -m256 jim' displays only the total size of
'fred', but complete information on 'jim'.
If no directory is specified, then @ (ie. the CSD) is
assumed.
Flags may be catenated unless they require a numeric
argument. Thus, 'du -nCs fred' is valid, as is
'du -nCm4 -D fred', whereas 'du -nCm4D fred' is not.
If you wish to alter the default options, you'll have to alter
and recompile the source code.
df
~~
Well, du wouldn't be complete without df, would it? df lists
the capacities, names, types, etc. of available discs. It's a bit like
doing a '*free' on all your discs at once, with the exception that df
also gives a %capacity figure.
du is not perfect - it only knows how to get information from
filecore filing systems (which is just about all of them), and a few
of those are tricky. In particular, df will ignore the RamDisc, MemFS
and the like - this is because when asked they say 'No, I have no
drives associated with me'.
Basically, df is just a curio to bundle with du.
Contact:
e-mail: musus@argonet.co.uk
WWW: http://www.argonet.co.uk/users/musus/
Snail: c/o 23 Baronsway, Whitkirk, Leeds, LS15 7AW, ENGLAND.